﻿@model HopNguyenModel.Image
@{
    ViewBag.Title = "Sửa hình ảnh";
    Layout = "~/Views/Shared/_BackendLayout.cshtml";
}

<div class="page-header position-relative">
    <h1>Sửa hình ảnh
    </h1>
</div>
<!--/.page-header-->
<div class="row-fluid">
    <div class="tabbable">
        <ul class="nav nav-tabs" id="myTab">
            <li class="active">
                <a data-toggle="tab" href="#tab1">
                    <i class="green icon-home bigger-110"></i>
                    Thông tin chung
                </a>
            </li>
        </ul>
        <form id="validate" action="/cpanel/editimage" method="POST" enctype="multipart/form-data">
            <input type="hidden" name="Id" value="@Model.Id"/>
            <div class="tab-content">
                @if (ViewBag.msg == "success")
                {
                    <div class="alert alert-success">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <strong>Thành công!</strong> Cập nhật thành công.
                    </div>
                }
                @if (ViewBag.Error != null)
                {
                    <div class="alert alert-error">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <strong>Lỗi!</strong> @ViewBag.Error
                    </div>
                }
                <div class="tab-pane active" id="tab1">
                    <div class="formField">
                        <div class="row-fluid">
                            <div class="span2">
                                <span class="fLabel">Loại hình ảnh</span>
                            </div>
                            <div class="span9">
                                <div class="noSearch">
                                    @Html.DropDownList("TypeId", null, new { @class = "chzn-select" })
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="formField">
                        <div class="row-fluid">
                            <div class="span2">
                                <span class="fLabel">Tên ảnh</span>
                            </div>
                            <div class="span9">
                                <input type="text" name="name" value="@Model.Name">
                            </div>
                        </div>
                    </div>
                    <div class="formField">
                        <div class="row-fluid">
                            <div class="span2">
                                <span class="fLabel">Link đến</span>
                            </div>
                            <div class="span9">
                                <input type="text" name="Link" value="@Model.Link">
                            </div>
                        </div>
                    </div>
                    <div class="formField">
                        <div class="row-fluid">
                            <div class="span2">
                                <span class="fLabel">Hình ảnh</span>
                            </div>
                            <div class="span3">
                                <input type="file" name="image" id="id-input-file-2">
                                <img src="@Model.Image1" width="100px" height="80px"/>
                            </div>
                        </div>
                    </div>
                    <div class="formField">
                        <div class="row-fluid">
                            <div class="span12">
                                <strong>Mô tả</strong>
                                <textarea name="summary" rows="5">@Model.Summary</textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="formButtons">
                    <div class="row-fluid">
                        <div class="span2"></div>
                        <div class="span9">
                            <button class="btn btn-info" type="submit">
                                <i class="icon-ok bigger-110"></i>
                                Cập nhật
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
